apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}-bsf
  labels:
    epc-mode: bsf
spec:
  selector:
    epc-mode: bsf
  ports:
    - protocol: TCP
      port: 80   
      targetPort: 80
---  
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: {{ .Release.Name }}-bsf-deployment
  labels:
    epc-mode: bsf
spec:
  replicas: 1
  selector:
    matchLabels:
      epc-mode: bsf
  template:
    metadata:
      labels:
        epc-mode: bsf
    spec:    
      containers:
        - name: bsf
          image: "{{ .Values.open5gs.image.repository }}:{{ .Values.open5gs.image.tag }}"
          imagePullPolicy: {{ .Values.open5gs.image.pullPolicy }}
          command: ["open5gs-bsfd", "-c", "/open5gs/config-map/bsf.yaml"]
          volumeMounts:
          - name: {{ .Release.Name }}-bsf-config
            mountPath: /open5gs/config-map/bsf.yaml
            subPath: "bsf.yaml"
      volumes:
        - name: {{ .Release.Name }}-bsf-config
          configMap:
            name: {{ .Release.Name }}-bsf-config
